import request from '../utils/request'

/**
 * 获取商品列表
 * @param {Object} params {query, pagenum, pagesize}
 * @returns promise
 */
export const getGoodsList = params => request({
    url:'goods',
    params
})

/**
 * 删除商品
 * @param {Number} id 商品ID
 * @returns promise
 */
export const deleteGoodsAPI = id => request({
    method: 'delete',
    url: `goods/${id}`
})

/**
 * 增加商品
 * @param {Object} data {}
 * @returns promise
 */
export const addGoodsAPI = data => request({
    method: 'post',
    url:'goods',
    data
})